import 'package:cunyutech_flutter_ui/src/text/main.dart';
import 'package:cunyutech_flutter_ui/src/theme/main.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';


class Tag extends StatelessWidget {
  const Tag({
    Key key, 
    this.actived = true, 
    this.title = "标签", 
    this.color,
    this.borderColor,
    this.height = 27,
    this.width = 64,
    this.onTap,
  }) : super(key: key);

  final bool actived;
  final String title;
  final Color color;
  final double height;
  final double width;
  final VoidCallback onTap;
  final Color borderColor;

  @override
  Widget build(BuildContext context) {
    var cs = CYThemeData.of(context);
    return InkWell(
      onTap: onTap,
      child: Container(
        height: height,
        width: width,
        decoration: BoxDecoration(
          border: Border.all(color: borderColor ?? cs.foreColorSystem.borderColor, width: 1),
          borderRadius: BorderRadius.circular(height / 2),
          color: actived ? color ?? cs.backColorSystem.secondaryColor : Colors.transparent,
        ),
        child: CYParagraph(title, alignment: Alignment.center),
      ),
    );
  }
}